package com.background.dao.network;

import java.util.HashMap;

/**
 * Created by helloworld on 17-3-15.
 */
public class Rule {
    public Rule() {
    }

    public Rule(String url, HashMap<String, String> paramers, String selector, Method method) {
        this.url = url;
        this.paramers = paramers;
        this.selector = selector;
        this.method = method;
    }

    public String getUrl() {
        return url;
    }

    public Rule setUrl(String url) {
        this.url = url;
        return this;
    }

    public HashMap<String, String> getParamers() {
        return paramers;
    }

    public Rule setParamers(HashMap<String, String> paramers) {
        this.paramers = paramers;
        return this;
    }

    public String getSelector() {
        return selector;
    }

    public Rule setSelector(String selector) {
        this.selector = selector;
        return this;
    }

    public Method getMethod() {
        return method;
    }

    public Rule setMethod(Method method) {
        this.method = method;
        return this;
    }

    /**
     * 请求类型的枚举
    */
    public enum Method{
        GET("GET"),
        POST("POST");

        private String method;

        private Method(String method){
            this.method=method;
        }
    }



    /**
     * 链接
     */
    public String url;

    /**
     * 请求参数 k,v
     */
    public HashMap<String,String> paramers;

    /**
     * jquery 选择器
     */
    public String selector;


    /**
     * 请求的类型 Method.GET或Method.POST
     */
    private Method method = Method.GET;


}
